﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using VIA.Integration;
using VIA.Integration.Domain;
using VIA.Presentation;

namespace VIA.SiMoJi.Presentation
{
    /// <summary>
    /// FoxconnMESView.xaml 的交互逻辑
    /// </summary>
    [View(typeof(IFoxconnMESView))]
    public partial class FoxconnMESView : IFoxconnMESView
    {
        public FoxconnMESView()
        {
            InitializeComponent();
        }

        public IObject EditObject
        {
            get => this.GetViewModel<IObjectEditor>().EditObject;
            set => this.GetViewModel<IObjectEditor>().EditObject = value;
        }

        private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var tabItem = e.AddedItems[0] as TabItem;
            if (tabItem?.Header.ToString() == "调试界面")
            {
                btn_Save.Visibility = Visibility.Collapsed;
            }
            else
            {
                btn_Save.Visibility = Visibility.Visible;
            }
        }
    }
}
